const gameGloabNodes = {
    rootcanvas : {
        get(){
            let canvas = cc.find("Canvas");
            return canvas;
        }
    },
    //当前关卡
    controlpanel : {
        get( type ){
            type = type || "scr"
            let node = $T.findChildNode("game > control" , cc.find("Canvas"));
            return type =='node' ? node : $T.getScr(node);
        }
    },

    cameraComponent : {
        get(){
            let camera = $T.findChildNode("Camera" , cc.find("Canvas"));
            return camera.getComponent(cc.Camera);
        }
    },
    
    viruspanel : {
        get( type ){
            type = type || "scr"
            let node = $T.findChildNode("game > viruspanel" , cc.find("Canvas"));
            return type =='node' ? node : $T.getScr(node);
                
        }
    },

    gamepanel : {
        _d : null,
        get(){
            this._d = this._d || $T.findChildNode("game" , $G.get("rootcanvas"));
            return this._d;
        }
    },
    
    menuspanel : {
        get( type ){
            type = type || "scr"
            let node = $T.findChildNode("menus" , cc.find("Canvas"));
            return type =='node' ? node : $T.getScr(node);
                
        }
    },

    gloabGetGunStateNode : {
        _d : null ,
        get(){
            if(!this._d){
                this._d = $G.get('poolGetByName' , 'anode');
                let fn = ()=>{
                    $T.getScr(this._d).playFreameAnimate([
                        {
                            frame : $RES.g("img-rung-bg"),
                            size : [ 60 ,],
                            scale : [3,1], 
                            time : .6,
                            param : {}
                        }
                    ] , true );
                }
                fn();
            }

            return this._d;
        }
    }
} 
 
module.exports = gameGloabNodes; 